package com.xpgk.mvc.right;

import java.util.Date;

import com.jfinal.core.Controller;
import com.jfinal.kit.StrKit;
import com.jfinal.log.Log;
import com.xpgk.mvc.base.BaseValidator;
import com.xpgk.mvc.user.User;
import com.xpgk.tools.ToolDateTime;
import com.xpgk.tools.ToolRandoms;

@SuppressWarnings({ "unused" })
public class RightValidator extends BaseValidator {

	private static final Log log = Log.getLog(RightValidator.class);


	protected void validate(Controller controller) {
		String actionKey = getActionKey();
		if (actionKey.equals("/right/addRight")) {

			 vali();

		} else if (actionKey.equals("/right/updateRight")) {

			// 验证参数
			 vali();
		}
	}

	protected void vali() {
		validateString("right.name", 1, 50, "msg", "请填写名称!");
		validateString("right.uri", 1, 150, "msg", "请填写URI!");
		
	}

	protected void handleError(Controller controller) {
		controller.renderJson();
	}

}
